#ifndef DependencyPipe2OGrandChildren_H
#define DependencyPipe2OGrandChildren_H
#include"DependencyPipe.h"

class DependencyPipe2OGrandChildren : public DependencyPipe{
protected:
	virtual void addExtendedFeatures(DependencyInstance *instance, FeatureVector *fv);

	virtual void writeExtendedFeatures(DependencyInstance *instance, ObjectWriter &out);

	void addGrandFeatures(DependencyInstance *instance, int gpar, int par, int ch, FeatureVector *fv);

	void addGChildFeatures(DependencyInstance *instance, int gpar, int ch, FeatureVector *fv);

public:
	DependencyPipe2OGrandChildren(ParserOptions *options);

	virtual ~DependencyPipe2OGrandChildren();

	void fillFeatureVectors(DependencyInstance* instance, vector<vector<vector<double> > > &probs,
		vector<vector<vector<double> > > &probs_grands, vector<vector<double> > &probs_gchs, vector<vector<vector<vector<double> > > > &nt_probs, 
		Parameters* params);

	DependencyInstance* readInstance(ObjectReader &in, int length, vector<vector<vector<double> > > &probs,
		vector<vector<vector<double> > > &probs_grands, vector<vector<double> > &probs_gchs, vector<vector<vector<vector<double> > > > &nt_probs, 
		Parameters* params);
};

#endif
